package mp

import (
	"duoke/service"
	"duoke/utils/gconv"
	"duoke/utils/response"
	"github.com/gin-gonic/gin"
)

var Reward = new(rewardCtl)

type rewardCtl struct{}

func (ctl *rewardCtl) MyList(c *gin.Context) {
	userR, _ := service.Request.User(c)
	list, _, err := service.Reward.List(c, "user_id ="+gconv.String(userR.Id), 1000, "")
	if err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	response.Success(c, "", list)
}
